#include <string>
#include <sys/time.h>

using namespace std;

class CMyMDApi;
class CMyMDSpi :
	public CThostFtdcMdSpi
{
public:
	CMyMDSpi(CMyMDApi * pApi);
	virtual ~CMyMDSpi();

	virtual void OnFrontConnected();
	virtual void OnFrontDisconnected(int nReason);
	virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
	virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData);
public:
	CMyMDApi * m_pApi;

    //临时错误信息存储变量
	char tmpmsg[81];

    //回报速度统计变量
	struct  timeval endtime;
	int timegap;

	//tmp instrid
	string tmpinstrid;
};